/*
 * @Description: 
 * @Author: zhuying
 * @Date: 2024-09-25 15:23:04
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-25 15:28:42
 */
/**
 * Test04Replace
 */
public class Test04Replace {

    public static void main(String[] args) {
        String str="Hello,world!";
        String newStr=str.replace('l', 'L');
        System.out.println(newStr);//HeLLo,worLd!
        String newStr1=str.replace("world", "Java");
        System.out.println(newStr1);
    }
}